const app = getApp();
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    book_list:[],
  },

  onShow:function(){
    this.getBookList(); //获取账本
  },

  //获取账本
  getBookList:function(){
    let _this = this;
    app._post('api/member/getUserBookList', {}, function(result) {
      if(result.code == 200){
        _this.setData({
          book_list:result.data
        })
      }else{
        wx.navigateTo({
          url: '/pages/auth/auth'
        })
      }
    });
  },

  //账本详情
  book_datail:function(e){
    let _this = this,
      book_id = e.currentTarget.dataset.bookid;
    wx.navigateTo({
      url: './edit_book?book_id='+book_id,
    })
  },

  //创建账本
  create_book:function(){
    wx.navigateTo({
      url: './create_book',
    })
  },

})